package com.ht.common.core.exception;

import com.ht.common.core.utils.StringUtils;

/**
 * 检查异常
 * 
 * @author ruoyi
 */
public class CheckedException extends RuntimeException
{
	private static final long serialVersionUID = 1L;

    /**
     * 错误码
     */
    private Integer code=500;

    /**
     * 错误提示
     */
    private String message;

    /**
     * 错误明细，内部调试错误
     *
     * 和 {@link CommonResult#getDetailMessage()} 一致的设计
     */
    private String detailMessage;

    /**
     * 空构造方法，避免反序列化问题
     */
    public CheckedException()
    {
    }

   
    
    public CheckedException(Integer code,String message,Object ...obj)
    {
    	this.code=code;
    	this.message = StringUtils.format(message, obj);
    }
    public CheckedException(String message,Object ...obj)
    {
    	this.message = StringUtils.format(message, obj);
    }
   

    public String getDetailMessage()
    {
        return detailMessage;
    }

    @Override
    public String getMessage()
    {
        return message;
    }

    public Integer getCode()
    {
        return code;
    }
   
}
